#ifndef _DEVICE_H_
#define _DEVICE_H_

#include "rgblinkProtocol.h"
#include "rgblink_device.h"

extern RgblinkDevice *ptr_device;

void device_init(void);

void device_send_str(char *str, int len);

void device_writeBuf(char *buf, int len);


void device_receive_buffer(BYTE *buffer, int len);

void device_task(void);

void close_device(void);

int open_device(char *deviceName, int speed, char parity);

void device_processCmd(BYTE * buffer);
void com_device_processCmd(BYTE * cmdbuffer);

int isInTbarMode(void);
void sendTbarValue(int value);
void enterTbarMode(void);
void exitTbarMode(void);
void setTbarValueToDevice1024(int value);



int processBuffer(char *buf, int len);





























#endif

